package com.loongtech.bi.manager.player;

import com.loongtech.bi.entity.player.EntityDaLoginTime;
import com.loongtech.core.jpa.manager.ManagerQueryCacheBase;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DaLoginTimeManager extends ManagerQueryCacheBase<EntityDaLoginTime> {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 根据开始结束时间，求平均登录次数
	 * @param dateStart
	 * @param dateEnd
	 * @return
	 */
	public List<EntityDaLoginTime> getDaLoginTimeByDate(Date dateStart, Date dateEnd) {
		return findByQuery("from EntityDaLoginTime where 1=1 and day>=:dayStart and day<=:dayEnd order by day ", "dayStart", dateStart, "dayEnd", dateEnd);
	}

    /**
     * 根据开始结束时间，求平均登录次数
     * @param dateStart
     * @param dateEnd
     * @return
     */
    public List<EntityDaLoginTime> getDaLoginTimeByDate2(Date dateStart, Date dateEnd) {
        return findByQuery("from EntityDaLoginTime where 1=1 and day>=:dayStart and day<=:dayEnd and serverid='0' order by day ", "dayStart", dateStart, "dayEnd", dateEnd);
    }
}
